const Router = require('koa-router')
const MessageController = require('../controllers/message.controller')
const jwt = require('../middlewares/jwt.middleware')

const router = new Router()
const messageController = new MessageController()
router.prefix('/api/messages')

router.get('/', jwt, messageController.findAll)

router.get('/:id', jwt, messageController.findOne)

router.patch('/:id', jwt, messageController.updateOne)

router.delete('/:id', jwt, messageController.deleteOne)

module.exports = router